//LINE FOLLOWER: Follows a dark line on a white (light) surface //Authors: Ravi Prakash, Alexis Mackenzie and Zubia Jamil //Hardware : Handyboard, Expansion Board //Motor Left on Port 0 //Motor Right on Port 3 //Infrared sensor on port 22 #define MOTORLEFT 0 #define MOTORRIGHT 3 #define LOWERBOUND 228 #define UPPERBOUND 232 #define SENSORPORT 22 #define MEMORYSIZE 3 #define SAMPLINGFREQ 0.05 int state, memory[MEMORYSIZE], pointer; void main() { // state=1 for black and state=0 for white int turn=1; //turn==1 for right and turn==-1 for left initialise(); while(1) { if(getState()==1) { motor(MOTORLEFT, 100); motor(MOTORRIGHT, 100); } else { int oscill=2, i; while(getState()!=1) { for(i=0; iUPPERBOUND) state=1; if(val